<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/static/reasahi/js/daterangepicker.css" th:href="@{/reasahi/js/daterangepicker.css}" rel="stylesheet"/>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="btn-group hidden-xs" id="toolbar" role="group">
        <button type="button" class="btn btn-outline btn-default" onclick="batchRemove()"
                shiro:hasPermission="manage:users:batchRemove">
            <i class="fa fa-trash-o"></i> 删除
        </button>
        <label style="margin-left: 10px" type="button" class="btn btn-primary" onclick="resetForm()" id=""><i
                class="fa fa-paper-plane"></i>&nbsp;重置
        </label>
        <label style="margin-left: 10px" type="button" class="btn btn-primary" onclick="search()" id=""><i
                class="fa fa-search"></i>&nbsp;搜索
        </label>
    </div>
    <div class="btn-group hidden-xs" id="toolbar1" role="group">
        <form id="searchForm">
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">用户ID</button>
                    </div>
                    <input type="text" class="form-control" id="usId" placeholder="用户ID">
                </div>
            </div>
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">用户名</button>
                    </div>
                    <input type="text" class="form-control" id="usNickname" placeholder="用户名">
                </div>
            </div>
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">推荐人ID</button>
                    </div>
                    <input type="text" class="form-control" id="usParentId" placeholder="推荐人ID">
                </div>
            </div>
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">支付宝账号</button>
                    </div>
                    <input type="text" class="form-control" id="afbPhone" placeholder="支付宝账号">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">金币</button>
                    </div>
                    <input style="width: 50%" type="number" id="startGoldCoin" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endGoldCoin" type="number" class="form-control"
                           placeholder="end">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">红包</button>
                    </div>
                    <input style="width: 50%" type="number" id="startRedPacket" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endRedPacket" type="number" class="form-control"
                           placeholder="end">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">累计签到</button>
                    </div>
                    <input style="width: 50%" type="number" id="startSignInNumber" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endSignInNumber" type="number" class="form-control"
                           placeholder="end">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">连续签到</button>
                    </div>
                    <input style="width: 50%" type="number" id="startSignIdDayNumber" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endSignIdDayNumber" type="number" class="form-control"
                           placeholder="end">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">今天签到</button>
                    </div>
                    <select class="form-control input-s-sm inline" id="signIn"
                            th:with="type=${@dictService.selectDictData('user_sign_in')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">是否有效</button>
                    </div>
                    <select class="form-control input-s-sm inline" id="effective"
                            th:with="type=${@dictService.selectDictData('user_effective')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">账号状态</button>
                    </div>
                    <select class="form-control input-s-sm inline" id="status"
                            th:with="type=${@dictService.selectDictData('user_status')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">累计登录</button>
                    </div>
                    <input style="width: 50%" type="number" id="startLoginDayNumber" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endLoginDayNumber" type="number" class="form-control"
                           placeholder="end">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">连续登录</button>
                    </div>
                    <input style="width: 50%" type="number" id="startLoginInDayNumber" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endLoginInDayNumber" type="number"
                           class="form-control"
                           placeholder="end">
                </div>
            </div>
            <div style="margin-top: 10px;" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">注册IP</button>
                    </div>
                    <input type="text" class="form-control" id="joinIp" placeholder="注册IP">
                </div>
            </div>
            <div style="margin-top: 10px; margin-left: -16px; margin-right: 16px" class="col-xs-3">
                <div class="col-sm-9" style="width: 108%">
                    <div class="form-group">
                        <div class="input-group date">
                            <span class="input-group-addon">注册时间</span>
                            <input id="createTime" name="datePickerdatePickerRegister" type="text" class="form-control"
                                   value="">
                            <span class="input-group-addon" onclick="clearCreateInput()"><i class="fa fa-remove"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <table class="bootstrap-table" data-mobile-responsive="true">
    </table>
</div>
<div th:include="include :: footer"></div>
<script src="/static/reasahi/js/ry-table.js?v=1.1.6" th:src="@{/reasahi/js/ry-table.js?v=1.1.6}"></script>
<script src="/js/jquery-ui-1.10..min.js" th:src="@{/js/jquery-ui-1.10.4.min.js}"></script>
<script src="/static/reasahi/js/moment.js?v1.1.6" th:src="@{/reasahi/js/moment.js?v=1.1.6}"></script>
<script src="/static/reasahi/js/daterangepicker.js?v1.1.6" th:src="@{/reasahi/js/daterangepicker.js?v=1.1.6}"></script>
<script src="/reasahi/manage/users/users.js" th:src="@{/reasahi/manage/users/users.js}"></script>
<script th:inline="javascript">
    var editFlag = [[${@permissionService.hasPermi('manage:users:edit')}]];
    var removeFlag = [[${@permissionService.hasPermi('manage:users:remove')}]];
    var resetUsParentIdFlag = [[${@permissionService.hasPermi('manage:users:resetUsParentId')}]];
    var resetKickbackFlag = [[${@permissionService.hasPermi('manage:users:resetKickback')}]];
    var antiCheatDetailAdd = [[${@permissionService.hasPermi('manage:antiCheatDetail:add')}]];

    var userId = sessionStorage.getItem("userId");
    if(userId){
        $("#usParentId").val(userId);
        $("#usParentId").prop('disabled',true);
    }
    var startCreatTime = moment().hours(0).minutes(0).seconds(0);
    startCreatTime = startCreatTime.format('YYYY-MM-DD HH:mm:ss');
    var endTime = moment().hours(23).minutes(59).seconds(59);
    endTime = endTime.format('YYYY-MM-DD HH:mm:ss');

    $('input[name="datePickerdatePickerRegister"]').daterangepicker({
            // timePicker: false, //显示时间
            // timePicker24Hour: false, //时间制
            // timePickerSeconds: false, //时间显示到秒
            startDate: moment().hours(0).minutes(0).seconds(0), //设置开始日期
            endDate: moment(new Date()), //设置结束器日期
            maxDate: moment(new Date()), //设置最大日期
            "opens": "center", ranges: {
                '今天': [moment(), moment()],
                '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
                '上周': [moment().subtract(6, 'days'), moment()],
                '前30天': [moment().subtract(29, 'days'), moment()],
                '本月': [moment().startOf('month'), moment().endOf('month')],
                '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
            },
            showWeekNumbers: true, locale: {
                format: "YYYY-MM-DD", //设置显示格式
                applyLabel: '确定', //确定按钮文本
                cancelLabel: '取消', //取消按钮文本
                customRangeLabel: '自定义',
                daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
                monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
                firstDay: 1
            },
        },
        function (start, end, label) {
            var timeRangeChange = [start.format('YYYY-MM-DD HH:mm:ss'), end.format('YYYY-MM-DD HH:mm:ss')];
            console.log(timeRangeChange);
            startCreatTime = start.format('YYYY-MM-DD HH:mm:ss');
            endTime = end.format('YYYY-MM-DD HH:mm:ss');
        });
    function clearCreateInput() {
        $('#createTime').val('');
        console.log(startCreatTime);
        console.log(endTime);
    }

    function resetForm() {
        cmResetForm();
        search();
        var userId = sessionStorage.getItem("userId");
        if(userId){
            $("#usParentId").val(userId);
        }
    }
</script>
</body>
</html>